package com.learning.jquizenglish.common.controller;

import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import com.learning.jquizenglish.R;

public class SimpleHeaderBar {

	protected Fragment mFrag;
	public SimpleHeaderBar(Fragment frag){
		mFrag = frag;
	}
	
	public View onCreateHeaderView(LayoutInflater inflater,
			ViewGroup container) {
		View v = inflater.inflate(R.layout.header_bar_default, container,false);
		v.findViewById(R.id.layoutBack).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				if(mFrag!=null){
					mFrag.getActivity().onBackPressed();
				}
			}
		});
		return v;
	}
	
}
